﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tron.Players.Search
{
    /**
     * <summary>Wraps a Heuristic implementation and
     * scales the values based upon the depth of the node.</summary>
     */
    public class HeuristicDepthScaler: IHeuristic
    {
        IHueristic wrappedHeuristic;

        HeuristicDepthScaler(IHeuristic heuristic)
        {
            wrappedHeuristic = heuristic;
        }

        public double evaluate(int[,] board, int depth, Vector2 agentLoc, Vector2 opponentLoc)
        {
            double res = evaluate(board, depth, agentLoc, opponentLoc);

            res /= Math.Pow(2, depth);

            return res;
        }
    }
}
